<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="HeadingTmplt.aspx.cs" Inherits="HeadingTmplt" title="Project Monitoring System" culture="auto:en-US" uiculture="auto" meta:resourcekey="PageResource1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server" Visible="false">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:ObjectDataSource ID="ODSHeadingTmplt" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
        SelectMethod="GetHeadingTemplateData" TypeName="IPTableAdapters.HeadingTemplateTableAdapter"
        UpdateMethod="Update" OldValuesParameterFormatString="original_{0}">
        <DeleteParameters>
            <asp:Parameter Name="HeadingCode" Type="String" />
            <asp:Parameter Name="Section" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="HeadingName" Type="String" />
            <asp:Parameter Name="HeadingNameChinese" Type="String" />
            <asp:Parameter Name="HeadingDescription" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="HeadingCode" Type="String" />
            <asp:Parameter Name="Section" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="HeadingCode" Type="String" />
            <asp:Parameter Name="HeadingName" Type="String" />
            <asp:Parameter Name="HeadingNameChinese" Type="String" />
            <asp:Parameter Name="HeadingDescription" Type="String" />
            <asp:Parameter Name="Section" Type="Int32" />
            <asp:Parameter Name="CreateBy" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="OwnerGroupID" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <div style="margin-left:10px;margin-right:10px;">
        <asp:Panel ID="SearchPanel" runat="server">
            <fieldset>
                <legend><asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblSearchResource1"></asp:Label></legend>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblSearchProcCode" runat="server" Text="Procedure Code:" meta:resourcekey="lblHeadingCodeResource1" Width="120px"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchProcCode" runat="server" Width="120px"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblSearchProcName" runat="server" Text="Procedure Name:" meta:resourcekey="lblHeadingNameResource1" Width="120px"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchProcName" runat="server" Width="120px"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="btnSearch" runat="server" Text="Search" CausesValidation="false"
                                meta:resourcekey="btnSearch" OnClick="btnSearch_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
        <fieldset>
            <legend><asp:Label ID="lblEdit" runat="server" Text="Edit Procedure Template" meta:resourcekey="lblEditResource1"></asp:Label></legend>
            <table>
                <tr>
                    <td width="100" align="left">
                        <asp:Label ID="lblHeadingCode" runat="server" Text="Procedure Code" meta:resourcekey="lblHeadingCodeResource1"></asp:Label>
					</td>
                    <td width="100" align="left">
                        <asp:TextBox ID="txtHeadingCode" runat="server" CssClass="required" meta:resourcekey="txtHeadingCodeResource1" MaxLength="30"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtHeadingCode" Display="Dynamic" ErrorMessage="Procedure Code is a required field." meta:resourcekey="RequiredFieldValidator1Resource1">
						</asp:RequiredFieldValidator>
					</td>
					<td width="10"></td>
                    <td width="150" align="left">
                        <asp:Label ID="lblHeadingName" runat="server" Text="Procedure Name" meta:resourcekey="lblHeadingNameResource1"></asp:Label>
					</td>
                    <td width="100" align="left">
                        <asp:TextBox ID="txtHeadingName" runat="server" Width="200px" meta:resourcekey="txtHeadingNameResource1" MaxLength="100"></asp:TextBox>
					</td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="lblHeadingChineseName" runat="server" Text="Procedure Chinese Name" meta:resourcekey="lblHeadingChineseNameResource1"></asp:Label>
					</td>
                    <td align="left">
                        <asp:TextBox ID="txtHeadingChineseName" runat="server" Width="200px" meta:resourcekey="txtHeadingChineseNameResource1" MaxLength="100"></asp:TextBox>
					</td>
                    <td width="10"></td>
                    <td align="left">
                        <asp:Label ID="lblHeadingDescription" runat="server" Text="Procedure Description" meta:resourcekey="lblHeadingDescriptionResource1"></asp:Label></td>
                    <td align="left">
                        <asp:TextBox ID="txtHeadingDescription" runat="server" Width="200px" meta:resourcekey="txtHeadingDescriptionResource1" MaxLength="100"></asp:TextBox>
					</td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:Label ID="lblSection" runat="server" Text="Section" Width="178px" meta:resourcekey="lblSectionResource1"></asp:Label>
					</td>
                    <td align="left">
                        <asp:DropDownList ID="ddlSection" runat="server" CssClass="required" Width="155px"
                            meta:resourcekey="ddlSectionResource1">
                        </asp:DropDownList>                        
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlSection"
                            Display="Dynamic" ErrorMessage="Section is a required field." meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
					</td>
                </tr>
                 <tr>
                    <td>
                        <asp:Label ID="lblGrouptype" runat="server" Text="Group Type:" Width="107px" meta:resourcekey="lblGroupTypeResource1"></asp:Label>
					</td>
                    <td colspan="4">
						<asp:Repeater ID="rptGroupType" runat="server">
							<ItemTemplate>                  
								<asp:CheckBox Text='<%# Eval("Code")%>'  CssClass="GroupcodeStyle" runat="server" id="chkGroupTP" />
							</ItemTemplate>                    
						</asp:Repeater>                    
                    </td>                       
                </tr>
                <tr>
                    <td colspan="5" style="text-align: center">
                        <asp:Button ID="btnNew" runat="server" CausesValidation="False" CssClass="submit" OnClick="btnNew_Click" Text="New" meta:resourcekey="btnNewResource1" />
                        <asp:Button ID="btnModify" runat="server" CausesValidation="False" CssClass="submit" OnClick="btnModify_Click" Text="Edit" meta:resourcekey="btnModifyResource1" />
                        <asp:Button ID="btnSave" runat="server" CssClass="submit" OnClick="btnSave_Click" Text="Save" meta:resourcekey="btnSaveResource1" />
                        <asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="submit" OnClick="btnDelete_Click" Text="Delete" meta:resourcekey="btnDeleteResource1" />
                        <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CssClass="reset" OnClick="btnCancel_Click" Text="Cancel" meta:resourcekey="btnCancelResource1" />
                    </td>
                </tr>
            </table>
            <asp:CheckBox ID="chkForOperation" runat="server" Visible="False" meta:resourcekey="chkForOperationResource1" />
            <asp:CheckBox ID="cbForUpdate" runat="server" Height="2px" Visible="False" Width="121px" meta:resourcekey="cbForUpdateResource1" />
        </fieldset>
        <table width="100%">
            <tr>
                <td align="center">
                    <asp:Label ID="lblError" runat="server" CssClass="error" ForeColor="Red" Width="100%" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
	    <asp:Panel ID="Panel1" runat="server" meta:resourcekey="Panel1Resource1">
            <asp:GridView CssClass="Grid" ID="gvHeadingTmplt" runat="server" AllowSorting="True"
                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#66000" BorderStyle="Solid"
                    BorderWidth="1px" CellPadding="0" CellSpacing="0" 
                    EmptyDataText="No Heading Template Record Aavailable!" meta:resourcekey="gvHeadingTmpltResource1"
                    AllowPaging="True"  Width="100%"
                    DataKeyNames="HeadingCode,Section,HeadingName,HeadingNameChinese,HeadingDescription"
                    OnSelectedIndexChanged="gvHeadingTmplt_SelectedIndexChanged"
                    OnPageIndexChanging="gvHeadingTmplt_PageIndexChanging" 
                    OnRowCreated="gvHeadingTmplt_RowCreated">
                <Columns>
                    <asp:BoundField DataField="HeadingCode" HeaderText="Procedure Code" ReadOnly="True" SortExpression="HeadingCode" meta:resourcekey="BoundFieldResource1">
                        <ItemStyle HorizontalAlign="Left" Width="100px" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="HeadingName" HeaderText="Procedure Name" SortExpression="HeadingName" meta:resourcekey="BoundFieldResource2">
                        <ItemStyle HorizontalAlign="Left" Wrap="False" Width="300px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="HeadingNameChinese" HeaderText="Procedure Name Chinese" SortExpression="HeadingNameChinese" meta:resourcekey="BoundFieldResource3">
                        <ItemStyle HorizontalAlign="Left" Width="200px" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="HeadingDescription" HeaderText="Procedure Description" SortExpression="HeadingDescription" meta:resourcekey="BoundFieldResource4">
                        <ItemStyle HorizontalAlign="Left" Width="200px" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Section" Visible="false" HeaderText="Section" ReadOnly="True" SortExpression="Section" meta:resourcekey="BoundFieldResource5">
                        <ItemStyle HorizontalAlign="Left" Width="80px" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="SectionName" HeaderText="Section" ReadOnly="True" SortExpression="Section" meta:resourcekey="BoundFieldResource5">
                        <ItemStyle HorizontalAlign="Left" Width="80px" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CreateBy" HeaderText="Create By" SortExpression="CreateBy" meta:resourcekey="BoundFieldResource6" />
                    <asp:BoundField DataField="UpdateBy" HeaderText="Update By" SortExpression="UpdateBy" meta:resourcekey="BoundFieldResource7" />
                    <asp:BoundField DataField="OwnerGroupID" HeaderText="OwnerGroupID" SortExpression="OwnerGroupID" Visible="False" meta:resourcekey="BoundFieldResource8"/>
                    <asp:CommandField ShowSelectButton="True" HeaderStyle-Width="60" ItemStyle-HorizontalAlign="center" ItemStyle-CssClass="btnEdit" meta:resourcekey="CommandFieldResource1"/>
                </Columns>
                <HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
                <RowStyle CssClass="GridRowStyle"/>
                <SelectedRowStyle CssClass="GridSelectedRowStyle"/>
                <PagerStyle CssClass="GridPagerStyle" ForeColor="White"/>
                <FooterStyle CssClass="GridFooterStyle"/>
            </asp:GridView>
        </asp:Panel>
    </div>
</asp:Content>

